﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ECRMS.WinForm.BaseClass;
using DevExpress.XtraBars;

namespace ECRMS.WinForm.Modules
{
    public partial class BaseModule : DevExpress.XtraEditors.XtraUserControl
    {
        public Core core = Core.getInstance();

        public BaseModule()
        {
            InitializeComponent();
            InitView();
        }

        private void InitView()
        {
            this.Dock = DockStyle.Fill;
        }

        protected bool MenuBarVisiable
        {
            get { return bar.Visible; }
            set { bar.Visible = value; }
        }
        #region 按钮显示设置

        protected bool newBarButtonVisiable
        {
            get { return newBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { newBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }

        protected bool updateBarButtonVisiable
        {
            get { return editBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { editBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool delBarButtonVisiable
        {
            get { return delBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { delBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool selectBarButtonVisiable
        {
            get { return selectBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { selectBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool saveBarButtonVisiable
        {
            get { return saveBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { saveBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool refreshBarButtonVisiable
        {
            get { return refreshBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { refreshBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool outBarButtonVisiable
        {
            get { return outBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { outBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool otherBarButton1Visiable
        {
            get { return otherBarButton1.Visibility == BarItemVisibility.Always ? true : false; }
            set { otherBarButton1.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool otherBarButton2Visiable
        {
            get { return otherBarButton2.Visibility == BarItemVisibility.Always ? true : false; }
            set { otherBarButton2.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        protected bool otherBarButton3Visiable
        {
            get { return otherBarButton3.Visibility == BarItemVisibility.Always ? true : false; }
            set { otherBarButton3.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        
        #endregion

        public virtual void newBarButton_ItemClick(object sender, ItemClickEventArgs e)
        {
            
        }

        public virtual void editBarButton_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void delBarButton_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void selectBarButton_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void saveBarButton_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void refreshBarButton_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void outBarButton_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void otherBarButton1_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void otherBarButton2_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void otherBarButton3_ItemClick(object sender, ItemClickEventArgs e)
        {

        }

        protected string newBarButtonContent
        {
            get { return newBarButton.Caption; }
            set { newBarButton.Caption = value; }
        }

        protected string updateBarButtonContent
        {
            get { return editBarButton.Caption; }
            set { editBarButton.Caption = value; }
        }
        protected string delBarButtonContent
        {
            get { return delBarButton.Caption; }
            set { delBarButton.Caption = value ; }
        }
        protected string selectBarButtonContent
        {
            get { return selectBarButton.Caption; }
            set { selectBarButton.Caption = value; }
        }
        protected string saveBarButtonContent
        {
            get { return saveBarButton.Caption; }
            set { saveBarButton.Caption = value; }
        }
        protected string refreshBarButtonContent
        {
            get { return refreshBarButton.Caption; }
            set { refreshBarButton.Caption = value; }
        }
        protected string outBarButtonContent
        {
            get { return outBarButton.Caption; }
            set { outBarButton.Caption = value ; }
        }
        protected string other1BarButton1Content
        {
            get { return otherBarButton1.Caption; }
            set { otherBarButton1.Caption = value; }
        }
        protected string other2BarButton2Content
        {
            get { return otherBarButton2.Caption; }
            set { otherBarButton2.Caption = value ; }
        }
        protected string other3BarButton3Content
        {
            get { return otherBarButton3.Caption; }
            set { otherBarButton3.Caption = value; }
        }

        protected int newBarButtonImgaeIndex
        {
            get { return newBarButton.ImageIndex; }
            set { newBarButton.ImageIndex = value; }
        }

        protected int updateBarButtonImgaeIndex
        {
            get { return editBarButton.ImageIndex; }
            set { editBarButton.ImageIndex = value; }
        }
        protected int delBarButtonImgaeIndex
        {
            get { return delBarButton.ImageIndex; }
            set { delBarButton.ImageIndex = value; }
        }
        protected int selectBarButtonImgaeIndex
        {
            get { return selectBarButton.ImageIndex; }
            set { selectBarButton.ImageIndex = value; }
        }
        protected int saveBarButtonImgaeIndex
        {
            get { return saveBarButton.ImageIndex; }
            set { saveBarButton.ImageIndex = value; }
        }
        protected int refreshBarButtonImgaeIndex
        {
            get { return refreshBarButton.ImageIndex; }
            set { refreshBarButton.ImageIndex = value; }
        }
        protected int outBarButtonImgaeIndex
        {
            get { return outBarButton.ImageIndex; }
            set { outBarButton.ImageIndex = value; }
        }
        protected int other1BarButton1ImgaeIndex
        {
            get { return otherBarButton1.ImageIndex; }
            set { otherBarButton1.ImageIndex = value; }
        }
        protected int other2BarButton2ImgaeIndex
        {
            get { return otherBarButton2.ImageIndex; }
            set { otherBarButton2.ImageIndex = value; }
        }
        protected int other3BarButton3ImgaeIndex
        {
            get { return otherBarButton3.ImageIndex; }
            set { otherBarButton3.ImageIndex = value; }
        }

    }
}
